home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0705.dms / q0705.adf / Amiga / HintsAndTips / Example1.c < prev    next >
C/C++ Source or Header  |  1992-07-29  |  2KB  |  60 lines

  1. /***********************************************************/
  2. /*                                                         */
  3. /* Amiga C Encyclopedia (ACE) V3.0      Amiga C Club (ACC) */
  4. /* -------------------------------      ------------------ */
  5. /*                                                         */
  6. /* Book:    ACM Amiga                   Amiga C Club       */
  7. /* Chapter: Hints And Tips              Tulevagen 22       */
  8. /* File:    Example1.c                  181 41  LIDINGO    */
  9. /* Author:  Anders Bjerin               SWEDEN             */
  10. /* Date:    92-05-07                                       */
  11. /* Version: 1.10                                           */
  12. /*                                                         */
  13. /*   Copyright 1992, Anders Bjerin - Amiga C Club (ACC)    */
  14. /*                                                         */
  15. /* Registered members may use this program freely in their */
  16. /*     own commercial/noncommercial programs/articles.     */
  17. /*                                                         */
  18. /***********************************************************/
  19.  
  20. /* This example tell you if you have an American (NTSC) or */
  21. /* European (PAL) system.                                  */ 
  22.  
  23.  
  24. /* Declares commonly used data types, such as UWORD etc: */
  25. #include <exec/types.h>
  26.  
  27. /* This header file declares the GfxBase structure: */
  28. #include <graphics/gfxbase.h>
  29.  
  30.  
  31. /* Pointer to the GfxBase structure. NOTE! This pointer must */
  32. /* allways be called "GfxBase"!                              */
  33. struct GfxBase *GfxBase;
  34.  
  35.  
  36. main()
  37. {
  38.   /* Open the Graphics Library: (any version) */
  39.   GfxBase = (struct GfxBase *)
  40.     OpenLibrary( "graphics.library", 0 );
  41.  
  42.   if( !GfxBase )
  43.     exit(); /* ERROR! Could not open the Graphics Library! */
  44.  
  45.  
  46.   if( GfxBase->DisplayFlags & NTSC )
  47.     printf( "You have an American (NTSC) Amiga.\n" );
  48.  
  49.   if( GfxBase->DisplayFlags & PAL )
  50.     printf( "You have an European (PAL) Amiga.\n" );
  51.  
  52.  
  53.   /* Close the Graphics Library: */
  54.   CloseLibrary( GfxBase );
  55.  
  56.  
  57.   /* Wait for a while: */
  58.   Delay( 5 * 50 );
  59. }
  60.